//
//  ItemCategoryModel.m
//  礼物go
//
//  Created by dllo on 16/5/27.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "ItemCategoryModel.h"
#import "ItemSubCategoryModel.h"

@implementation ItemCategoryModel

-(void)setValue:(id)value forUndefinedKey:(NSString *)key{
    if ([key isEqualToString:@"id"]) {
        self.myId = value;
    }

}


-(void)setSubcategories:(NSMutableArray *)subcategories{
    _subcategories = subcategories;
    NSMutableArray *array = [NSMutableArray array];
    for (NSDictionary *dic in subcategories) {
        ItemSubCategoryModel *model = [[ItemSubCategoryModel alloc] init];
        [model setValuesForKeysWithDictionary:dic];
        [array addObject:model];
    }
    _subcategories = [NSMutableArray arrayWithArray:array];
}




@end
